import sys
sys.setrecursionlimit(10**8)


def fib(n):
    def fib0(a, b, k):
        if k == 1:
            return a
        elif k == 2:
            return b
        else:
            return fib0(b, a+b, k-1)

    return fib0(1, 1, n)


print(fib(1000))
